#ifndef __MICRO_SWITCH_H
#define __MICRO_SWITCH_H
#include "device.h"

#define LEFT_UP_PORT      GPIOB
#define RIGHT_UP_PORT     GPIOC
#define LEFT_DOWN_PORT    GPIOC
#define RIGHT_DOWN_PORT   GPIOC


#define LEFT_UP_PIN       GPIO_PIN_9
#define RIGHT_UP_PIN      GPIO_PIN_13
#define LEFT_DOWN_PIN     GPIO_PIN_14
#define RIGHT_DOWN_PIN    GPIO_PIN_15

#define LEFT_UP_PORT_CLK_ENABLE       __HAL_RCC_GPIOB_CLK_ENABLE
#define RIGHT_UP_PORT_CLK_ENABLE      __HAL_RCC_GPIOC_CLK_ENABLE
#define LEFT_DOWN_PORT_CLK_ENABLE     __HAL_RCC_GPIOC_CLK_ENABLE
#define RIGHT_DOWN_PORT_CLK_ENABLE    __HAL_RCC_GPIOC_CLK_ENABLE




#define M1_PORT				GPIOB
#define M2_PORT      		GPIOC
#define M3_PORT     		GPIOC
#define M4_PORT    			GPIOC

#define M1_PIN       		GPIO_PIN_9
#define M2_PIN     	 		GPIO_PIN_14
#define M3_PIN     			GPIO_PIN_13
#define M4_PIN    			GPIO_PIN_15

#define M1_PORT_CLK_ENABLE    __HAL_RCC_GPIOB_CLK_ENABLE
#define M2_PORT_CLK_ENABLE    __HAL_RCC_GPIOC_CLK_ENABLE
#define M3_PORT_CLK_ENABLE    __HAL_RCC_GPIOC_CLK_ENABLE
#define M4_PORT_CLK_ENABLE    __HAL_RCC_GPIOC_CLK_ENABLE

typedef struct
{
	uint8_t sw1;
	uint8_t sw2;
	uint8_t sw3;
	uint8_t sw4;
}MICRO_FDBK,*P_MICRO_FDBK;

typedef enum
{
    SW_TOUCH,
    SW_NOT_TOUCH
} SW_STATE;

typedef enum
{
    L_UP,
    R_UP,
    L_DOWN,
    R_DOWN,
} SW_NUM;
void Micro_switch_Init(void);
SW_STATE Micro_switch_Read_State(SW_NUM sw_num);
#endif

